# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1PanelInfo do
  @moduledoc """
  Detailed panel information associated with a user event.

  ## Attributes

  *   `displayName` (*type:* `String.t`, *default:* `nil`) - The display name of the panel.
  *   `documents` (*type:* `list(GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1DocumentInfo.t)`, *default:* `nil`) - Optional. The document IDs associated with this panel.
  *   `panelId` (*type:* `String.t`, *default:* `nil`) - Required. The panel ID.
  *   `panelPosition` (*type:* `integer()`, *default:* `nil`) - The ordered position of the panel, if shown to the user with other panels. If set, then total_panels must also be set.
  *   `totalPanels` (*type:* `integer()`, *default:* `nil`) - The total number of panels, including this one, shown to the user. Must be set if panel_position is set.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :displayName => String.t() | nil,
          :documents =>
            list(GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1DocumentInfo.t())
            | nil,
          :panelId => String.t() | nil,
          :panelPosition => integer() | nil,
          :totalPanels => integer() | nil
        }

  field(:displayName)

  field(:documents,
    as: GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1DocumentInfo,
    type: :list
  )

  field(:panelId)
  field(:panelPosition)
  field(:totalPanels)
end

defimpl Poison.Decoder,
  for: GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1PanelInfo do
  def decode(value, options) do
    GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1PanelInfo.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1PanelInfo do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
